// 模拟 Vue 响应式声明
export default function useReactive<T>(value: T): { value: T } {
  const [data, setData] = useState<T>(value)
  console.log('useReactive');
  const obj = useMemo(() => {
    console.log('useMemo');
    return new Proxy<Record<"value", T>>({ value: data }, {
      get(obj, prop) {
        return obj[prop as "value"]
      },
      set(obj, prop, value) {
        console.log('设置值');
        setData(value)
        return obj[prop as "value"] = value
      }
    })
  }, [])
  return obj
}
